package test;

public class Person {

        private String name;
        private int age;

        public Person() {
        }

        public Person(String name, int age) {
            this.name = name;
            this.age = age;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        //行为
        public void eat(String food){
            System.out.println("姓名是"+name+"年龄是"+age+"的人在吃"+food);
        }
        public void sleep(){
            System.out.println("姓名是"+name+"年龄是"+age+"的人在吃");

        }
    }


